<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jquery.min.js"></script>
</head>
<body>
<table border="1">
    <form action="chaxuncangku.do">
        <tr>
            <td>仓库</td>
            <td colspan="5">
                <select name="storeId" id="storeId">
                    <option th:each="everyName:${session.manyCangkuName}" th:text="${everyName.storeName}" th:value="${everyName.storeId}" th:selected="${session.storeId eq everyName.storeId}"></option>
                </select>
            </td>
        </tr>
        <tr>
            <td></td>
            <td colspan="5"><input type="submit" value="查询"></td>
        </tr>
    </form>
</table>

<table id="table" border="1" th:if="${session.pageInfo!=null}">
    <tr><td>出库单号</td><td>货主</td><td>出库托盘个数</td><td>仓库</td><td>业务日期</td><td>备注</td><td>是否删除</td></tr>
    <tr th:each="everymap:${session.pageInfo.getList()}">
        <td th:text="${everymap.get('billID')} == null ? 'null' : ${everymap.get('billID')}"></td>
        <td th:text="${everymap.get('custName')} == null ? 'null' : ${everymap.get('custName')}"></td>
        <td th:text="${everymap.get('count')} == null ? 'null' : ${everymap.get('count')}"></td>
        <td th:text="${everymap.get('storeName')} == null ? 'null' : ${everymap.get('storeName')}"></td>
        <td th:text="${everymap.get('billDate')} == null ? 'null' : ${everymap.get('billDate')}"></td>
        <td th:text="${everymap.get('billNote')} == null ? 'null' : ${everymap.get('billNote')}"></td>
        <td th:text="${everymap.get('billIsDel')} == null ? 'null' : ${everymap.get('billIsDel')}"></td>
    </tr>
    <button th:value="${session.pageInfo.getPageNum()>1?session.pageInfo.getPageNum()-1:session.pageInfo.getPageNum()}" onclick="lastpage(this.value)">上一页</button>
    <select onchange="pageRows(this.value)" id="select" >
        <option>请选择</option>
        <option value="5"  th:selected="${session.pageInfo.pageSize == 5}">5</option>
        <option value="10" th:selected="${session.pageInfo.pageSize == 10}">10</option>
        <option value="15" th:selected="${session.pageInfo.pageSize == 15}">15</option>
    </select>
    <button th:value="${session.pageInfo.getPageNum()<session.pageInfo.getPages()?session.pageInfo.getPageNum()+1:session.pageInfo.getPageNum()}" onclick="lastpage(this.value)">下一页</button></tr>
</table>
</body>
<script>
    function pageRows(pageRows){
        var storeId = $("#storeId").val();
        var page = "";
        window.location = "chaxuncangku.do?page="+page+"&storeId="+storeId+"&pageRows="+pageRows;
    }
    function lastpage(page) {
        var storeId = $("#storeId").val();
        var select = $("#select").val();
        window.location = "chaxuncangku.do?page="+page+"&storeId="+storeId+"&pageRows="+select;
    }


</script>
</html>